﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace EFong.Contract
{
    [DataContract]
    public class InsurancePolicy : Order
    {
        public InsurancePolicy() 
        {
            OrderType = "保险单";
        }

        private string _type = string.Empty;
        [DataMember]
        public string Type
        {
            get { return _type; }
            set { _type = value; }
        }

        private decimal _basePrice;
        [DataMember]
        public decimal BasePrice
        {
            get { return _basePrice; }
            set { _basePrice = value; }
        }

        private decimal _listPrice;
        [DataMember]
        public decimal ListPrice
        {
            get { return _listPrice; }
            set { _listPrice = value; }
        }

        private Currency _currency;
        [DataMember]
        public Currency Currency
        {
            get { return _currency; }
            set { _currency = value; }
        }

        private string _status =  "可用";
        [DataMember]
        public string Status
        {
            get { return _status; }
            set { _status = value; }
        }

        private RVendor _vendor;
        [DataMember]
        public RVendor Vendor
        {
            get { return _vendor; }
            set { _vendor = value; }
        }

        private string _passenger = string.Empty;
        [DataMember]
        public string Passenger
        {
            get { return _passenger; }
            set { _passenger = value; }
        }

        private DateTime? _usedDate;
        [DataMember]
        public DateTime? UsedDate
        {
            get { return _usedDate; }
            set { _usedDate = value; }
        }

        //private bool _isDelete = false;
        //[DataMember]
        //public bool IsDelete
        //{
        //    get { return _isDelete; }
        //    set { _isDelete = value; }
        //}

        public override bool Equals(object obj)
        {
            InsurancePolicy temp = obj as InsurancePolicy;
            if (temp == null)
                return false;
            return (this.ID.Equals(temp.ID));
        }

        public override string ToString()
        {
            return Ref;
        }
    }
}
